//
//  UrlImageButton.h
//  test image
//
//  Created by Xuyan Yang on 8/06/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SDWebImageCompat.h"
#import "SDWebImageManagerDelegate.h"

#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

#define LFLog(xx, ...)  NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)


@interface UrlImageButton : UIButton <SDWebImageManagerDelegate> {	
    NSInteger iconIndex;

	CGSize scaleSize;
	BOOL    isScale;
	
	BOOL    _animated;
	BOOL    _isBackgroundImage;
    NSString* picUrl;
    CGRect frame_final;
    BOOL isLoad;
    
    NSArray *sizeDestArray;
    NSArray *sizeArray;
}

@property (nonatomic, assign) NSInteger iconIndex;
@property (nonatomic, retain) NSString* picUrl;

-(UIImage*) getDefaultImage;

- (void) setImageFromUrl:(BOOL)animated withUrl:(NSString *)iconUrl;
- (void) setBackgroundImageFromUrl:(BOOL)animated withUrl:(NSString *)iconUrl;

- (void)setImageWithURL:(NSURL *)url;
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;
- (void)cancelCurrentImageLoad;
- (BOOL)isLoad;

@end
